home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: news.iij.ad.jp!mewgate!mitsuru!news
- From: tomio@ai.mew.co.jp (Steven J. Madsen)
- Subject: Trouble with "system" function in BC++ 3.0
- Message-ID: <DMCG2B.LH0@isc.mew.co.jp>
- Sender: news@isc.mew.co.jp (USENET News System)
- Nntp-Posting-Host: unicorn.ai.mew.co.jp
- Organization: Matsushita Electric Works, Ltd., OSAKA, JAPAN
- X-Newsreader: Forte Free Agent 1.0.82
- Date: Tue, 6 Feb 1996 07:46:31 GMT
-
- I am trying to create a very simple .EXE file which will invoke a DOS
- EXE command. I am using the "system" function in BC++ 3.0.
-
- The problem I am having is that while my .cpp file compiles okay, the
- linker returns an error.
-
- Here's the source (I added a call to the "swab" function just to
- verify that my project can find the run time library):
- ------------------------------------------------------
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
-
- char source[15] = "rFna koBlrna d";
- char target[15];
-
- int main(void)
- {
- printf("About to spawn command.com and run a DOS command\n");
- swab(source, target, strlen(source));
- printf("This is target: %s\n", target);
- system("dir");
- return 0;
- }
-
-
- Here's the warning/error messages:
- ----------------------------------
- Compiling SYSTEST.CPP:
- Linking SYSTEST.EXE:
- Linker Warning: No module definition file specified: using defaults
- Linker Error: Undefined symbol _system in module SYSTEST.CPP
-
-
- The above code compiles and executes fine if I comment out the line
- with "system" in it.
-
- If possible, please e-mail suggestions to me at:
- tomio@ai.mew.co.jp
-
- Thanks all.
-
-
-
-